package com.guijq.design.command.remote;

import com.guijq.design.command.remote.commandimpl.LightOffCommand;
import com.guijq.design.command.remote.commandimpl.LightOnCommand;
import com.guijq.design.command.remote.controlobj.Light;

/**
 * @Author timyag
 * @Date 2021/4/19 15:17
 * @Version 1.0
 */
public class RemoteControlTest {

    public static void main(String[] args) {
        RemoteControl remoteControl = new RemoteControl();
        Light light = new Light();
        remoteControl.setCommand(0, new  LightOnCommand(light), new LightOffCommand(light));
        remoteControl.onButtonWasPushed(0);
        remoteControl.offButtonWasPushed(0);
    }
}
